<?php
class MY_Controller extends CI_Controller
{
    public function __construct(){
        parent::__construct();

        $user = $this->session->userdata['ses_user'];
        if(!$user){
            redirect (base_url()."admin/login");
            exit();
        }
    }
    public function debug($val){
        echo "<pre>";
        print_r($val);
        echo "</pre>";
    }
}